<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="UTF-8" />
        <title>09_防抖-总结</title>
        <style>
            div {
                width: 300px;
                height: 300px;
                border: 1px solid black;
            }
        </style>
    </head>
    <body>

        <div>1</div>

        <script src="./js/lodash.js"></script>


        <script>
            // 防抖应用：处理高频触发事件 
            // 应用场景：搜索框
            // 最后那次时间为主 

            var div = document.querySelector('div');

            function move(){
                div.innerHTML++;
            }

            document.addEventListener('mousemove',_.debounce(move,2000));

        </script>
    </body>
</html>